class Solution(object):
    def heightChecker(self, heights):
        """
        :type heights: List[int]
        :rtype: int
        """
        ex = heights.copy()
        ex.sort()
        c = 0
        for i in range(len(heights)):
            if heights[i] != ex[i]:
                c += 1
        return c